Custom Targeting Key
Update a custom targeting value
Updates a custom targeting value. Only the owner or an admin may update.
PATCH
/
api
/
manager
/
custom-targeting
/
values
/
{value_id}
Update a custom targeting value
curl --request PATCH \
--url https://your_a2_service/api/manager/custom-targeting/values/{value_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"display_name": "Male (updated)",
"ext": {}
}
'import requests
url = "https://your_a2_service/api/manager/custom-targeting/values/{value_id}"
payload = {
"display_name": "Male (updated)",
"ext": {}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({display_name: 'Male (updated)', ext: {}})
};
fetch('https://your_a2_service/api/manager/custom-targeting/values/{value_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://your_a2_service/api/manager/custom-targeting/values/{value_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'display_name' => 'Male (updated)',
'ext' => [
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://your_a2_service/api/manager/custom-targeting/values/{value_id}"
payload := strings.NewReader("{\n \"display_name\": \"Male (updated)\",\n \"ext\": {}\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://your_a2_service/api/manager/custom-targeting/values/{value_id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"display_name\": \"Male (updated)\",\n \"ext\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://your_a2_service/api/manager/custom-targeting/values/{value_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"display_name\": \"Male (updated)\",\n \"ext\": {}\n}"
response = http.request(request)
puts response.read_body{
"code": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"display_name": "<string>",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"updated_at": "2023-11-07T05:31:56Z",
"value": "<string>",
"deprecated": false,
"ext": {},
"match_type": "exact",
"no": 123
}{
"detail": {
"code": "AUTH.UNAUTHORIZED",
"message": "Authentication is required."
}
}{
"detail": {
"code": "AUTH.NO_PERMISSION",
"message": "do not have permission to perform this action."
}
}{
"detail": {
"code": "CUSTOM_TARGETING.VALUE_NOT_FOUND",
"message": "Custom targeting value not found."
}
}{
"detail": {
"code": "CUSTOM_TARGETING.KEY_DEPRECATED",
"message": "The parent custom targeting key is deprecated."
}
}{
"detail": {
"code": "COMMON.INVALID_VALUE",
"message": "Invalid value."
}
}Authorizations
Bearer authentication. Pass the access token in the Authorization: Bearer <token> header.
Path Parameters
Body
application/json
Response
Successful Response
Required string length:
1 - 32Pattern:
^[a-z][a-z0-9._-]{0,31}$Required string length:
1 - 100Required string length:
1 - 32Pattern:
^[a-z][a-z0-9._-]{0,31}$Available options:
exact Was this page helpful?
⌘I
Update a custom targeting value
curl --request PATCH \
--url https://your_a2_service/api/manager/custom-targeting/values/{value_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"display_name": "Male (updated)",
"ext": {}
}
'import requests
url = "https://your_a2_service/api/manager/custom-targeting/values/{value_id}"
payload = {
"display_name": "Male (updated)",
"ext": {}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({display_name: 'Male (updated)', ext: {}})
};
fetch('https://your_a2_service/api/manager/custom-targeting/values/{value_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://your_a2_service/api/manager/custom-targeting/values/{value_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'display_name' => 'Male (updated)',
'ext' => [
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://your_a2_service/api/manager/custom-targeting/values/{value_id}"
payload := strings.NewReader("{\n \"display_name\": \"Male (updated)\",\n \"ext\": {}\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://your_a2_service/api/manager/custom-targeting/values/{value_id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"display_name\": \"Male (updated)\",\n \"ext\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://your_a2_service/api/manager/custom-targeting/values/{value_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"display_name\": \"Male (updated)\",\n \"ext\": {}\n}"
response = http.request(request)
puts response.read_body{
"code": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"display_name": "<string>",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"updated_at": "2023-11-07T05:31:56Z",
"value": "<string>",
"deprecated": false,
"ext": {},
"match_type": "exact",
"no": 123
}{
"detail": {
"code": "AUTH.UNAUTHORIZED",
"message": "Authentication is required."
}
}{
"detail": {
"code": "AUTH.NO_PERMISSION",
"message": "do not have permission to perform this action."
}
}{
"detail": {
"code": "CUSTOM_TARGETING.VALUE_NOT_FOUND",
"message": "Custom targeting value not found."
}
}{
"detail": {
"code": "CUSTOM_TARGETING.KEY_DEPRECATED",
"message": "The parent custom targeting key is deprecated."
}
}{
"detail": {
"code": "COMMON.INVALID_VALUE",
"message": "Invalid value."
}
}